package com.rpay.service.admin.impl;

import com.rpay.dao.mapper.RpayAdminModuleMapper;
import com.rpay.model.admin.RpayAdminModule;
import com.rpay.model.admin.RpayAdminRole;
import com.rpay.service.admin.IModuleService;
import com.rpay.service.base.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 */
@Service("moduleServiceImpl")
public class ModuleServiceImpl extends BaseServiceImpl<RpayAdminModule> implements IModuleService {
    @Autowired
    private RpayAdminModuleMapper moduleMapper;

    @Override
    public List<RpayAdminModule> listModuleByUserId(long userId) {
        List<RpayAdminModule> moduleList = moduleMapper.listModuleByUserId(userId);
//        List<RpayAdminModule> moduleList = getSqlSessionTemplate().selectList("listModuleByUserId", userId);
        return moduleList;
    }

    @Override
    public List<RpayAdminModule> findTModuleList(RpayAdminRole role) {
        return moduleMapper.findTModuleList(role);
    }

    @Override
    public RpayAdminModule findParentModule(RpayAdminModule module) {
        return moduleMapper.findParentModule(module);
    }
}
